package com.hellogood.yaohuo.server.serviceImpl;

import java.util.LinkedHashMap;
import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.hellogood.yaohuo.server.mgr.factory.MgrFactory;
import com.hellogood.yaohuo.shared.entity.Cup;
import com.hellogood.yaohuo.shared.services.CupService;

@SuppressWarnings("serial")
public class CupServiceImpl extends RemoteServiceServlet implements CupService {

	@Override
	public List<Cup> getAllCupList() {
		return MgrFactory.getInstance().createCupMgr().getAllCup();
	}

	@Override
	public LinkedHashMap<String, String> getAllCupMap() {
		List<Cup> cupList = getAllCupList();
		LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
		map.put("无", "无");
		for (Cup c : cupList) {
			map.put(c.getCup(), c.getCup());
		}
		return map;
	}

}
